package com.life.utils;

import java.util.HashMap;

public class ClusterStruct
{
    public int[][] clusters = null;

    HashMap<Integer, Integer> clusterCounts = new HashMap<Integer, Integer>();

    public ClusterStruct(int x, int y)
    {
	clusters = new int[x][y];
    }

    public void setInCluster(int x, int y, int value)
    {
	clusters[x][y] = value;
    }

    public int getCluster(int x, int y)
    {
	return clusters[x][y];
    }

    public void setClusterCount(int clusterNumber, int value)
    {
	clusterCounts.put(new Integer(clusterNumber), new Integer(value));
    }

    public int getClusterCount(int value)
    {
	int returnVal = -1;
	try
	{

	    Integer valueInt = new Integer(value);

	    if (clusterCounts.containsKey(valueInt))
	    {
		returnVal = clusterCounts.get(valueInt).intValue();
	    }
	} catch (Exception ex)
	{
	    System.out.println("Could not retreive " + value);

	}
	return returnVal;
    }

}
